#ifndef _________world_h_______
#define _________world_h_______

#include "stdafx.h"
//#include <Ogre.h>
//#include "MyCommon.h"
//#include "Boid.h"
//#include "Wall3DStrip.h"
//#include "Path.h"

#include <OgreWireBoundingBox.h>

using namespace MyCommon;
using namespace Ogre;

class Boid;
class Wall3DStrip;
class Path;

typedef std::vector<Boid*> BoidVector;
typedef BoidVector::iterator BoidIter;
typedef std::vector<Ogre::Entity*> EntityVector;
typedef EntityVector::iterator EntityIter;
typedef Ogre::Real OgreReal;


class World
{
private:

	// boids container
	BoidVector mBoids;
	// non-movable entities container
	EntityVector mObstacles;
	// the walls
	Wall3DStrip *mWalls;
	//any path we may create for the Boids to follow
	Path* mPath;

	Ogre::SceneManager *mSceneManager;

	void CreateObstacles();
	void CreateWalls();

	float mDimX;
	float mDimZ;

	WireBoundingBox *wbbox;
public:

	World(float dimx,float dimz,Ogre::SceneManager* sm);
	~World();

	void Update(double timeElapsed);

	bool ObstacleOverlaps(Ogre::Entity* obstacle,OgreReal minGap=40.0);

	const Wall3DStrip* Walls() const { return mWalls; }
	const EntityVector& Obstacles() const {return mObstacles;}
	const BoidVector& Boids() const {return mBoids;}
	OgreReal NormalizeAgents(OgreReal scale);

	void ShowBoidBBox(bool bShow);
	void ToggleShowBBoxes(/*bool bShow*/);
};


#endif